package com.ljfresh.customer.page;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.util.List;

/**
 * @author: Lucifer
 * @time: 2020/4/9-15:25
 */
@ApiModel("分页数据")
public class PageResult<T>  {
    @ApiModelProperty("当前页")
    private Integer pageNum;

    @ApiModelProperty("页面大小")
    private Integer pageSize;

    @ApiModelProperty("总页面")
    private Integer totalNum;

    @ApiModelProperty("总页面大小")
    private Integer totalCount;

    @ApiModelProperty("数据")
    private List<T> list;

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotalNum() {
        return totalNum;
    }

    public void setTotalNum(Integer totalNum) {
        this.totalNum = totalNum;
    }

    public Integer getTotalCount() {
        return totalCount;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }

    public void setTotalCount(Integer totalCount){
        this.totalCount=totalCount;
        if (totalCount%this.pageSize!=0){
            totalNum = totalCount/this.pageSize+1;
        }else{
            totalNum = totalCount/this.pageSize;
        }
    }
}
